<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%		
	request.setCharacterEncoding("UTF-8");
	response.setContentType("text/html;charset=UTF-8");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%	
	
	String path = request.getContextPath();
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1" />		
		<meta name="author" content="wuqiong">
		<title>报名支付</title>
		<link rel="stylesheet" href="<%=path%>/css/bootstrap.min.css" />
		<link rel="stylesheet" href="<%=path%>/css/flat-ui.css" />		
		<link rel="stylesheet" href="<%=path%>/css/public.css" />
		<link rel="stylesheet" href="<%=path%>/css/index_yu.css" />
</head>
<body>
	
		
		<div class="container">
			<div class="thumbnail oh margin-bottom-15 margin-top-15">
				<div class="caption">
					<div class="support-title peter-river pay-title">抱走宝山在线报名</div>
					<ul class="pay-details">
						<li class='palette-paragraph'>订单号：<span class="pull-right peter-river">${order.orderNo }</span></li>
						<li class='palette-paragraph'>报名费用：<span class="pull-right c-red">￥${money}</span></li>						
					</ul>
				</div>
			</div>
			
			<div class="thumbnail margin-bottom-15">
			    <p class="xxy">选手信息</p>
				<table id="pay-table" class="tables">
					<tr>
						<th>选手姓名</th>
						<th class="thtwo">证件号码</th>
						<th>报名组别</th>
					</tr>
					<c:forEach items="${userList}" var="list" varStatus="s">
						<tr>
							<td>${list.name }</td>
							<td>${list.cerNumber }</td>
							<td><c:if test="${list.signType=='S'&& list.gender=='W'}">个人女子组</c:if><c:if test="${list.signType=='S'&& list.gender=='M'}">个人男子组 </c:if> 
						<c:if test="${list.signType=='F'}">家庭组</c:if>
						<c:if test="${list.signType=='G'}">团体组</c:if>
						<c:if test="${list.raceGroup=='A'}">10公里</c:if> 
						<c:if test="${list.raceGroup=='B' }">20公里</c:if>
						<c:if test="${list.raceGroup=='C' }">30公里</c:if></td>
						</tr>
					</c:forEach>

				</table>
			</div>

			<div class="margin-bottom-20"><button onclick="wxpay()" class="btn btn-info width101">支付</button></div>
			<div class="text-center" style="margin-top: 15px;">
				<a href="<%=path %>/user/clean" class="peter-river cancel-order" style="text-decoration: none;">重新报名</a>				
			</div>
		</div>
</body>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery-2.2.3.min.js" ></script>
<script type="text/javascript">
var jsParam=${jsParam};
function wxpay(){
	WeixinJSBridge.invoke(
		'getBrandWCPayRequest'
		,jsParam
		,callback
	);
}

function callback(res){ 
	//  返回 res.err_msg,取值 
	// get_brand_wcpay_request:cancel   用户取消 
    // get_brand_wcpay_request:fail  发送失败 
    // get_brand_wcpay_request:ok 发送成功 
     WeixinJSBridge.log(res.err_msg); 	     	     				 
     if(res.err_msg=='get_brand_wcpay_request:ok')
     {
     	window.location.href="<%=path%>/user/chanOrderState";
     }
	else
	{
		var msg='支付失败,请重新支付.';
		alert(msg);
		 alert(res.err_code+" err_desc="+res.err_desc+" err_msg="+res.err_msg); 	
	}
};
</script>
</html>